home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3s / wcstol.z / wcstol
Encoding:
Text File  |  2002-10-03  |  11.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. wwwwccccssssttttoooollll((((3333SSSS))))                                                          wwwwccccssssttttoooollll((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _wwww_cccc_ssss_tttt_oooo_llll, _wwww_cccc_ssss_tttt_oooo_uuuu_llll, _wwww_cccc_ssss_tttt_oooo_llll_llll, _wwww_cccc_ssss_tttt_oooo_uuuu_llll_llll - convert wide character string to
  10.      long integer, unsigned long integer, long long integer, unsigned long
  11.      long integer, respectively
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_wwww_cccc_hhhh_aaaa_rrrr_...._hhhh_>>>>
  15.  
  16.      _llll_oooo_nnnn_gggg _wwww_cccc_ssss_tttt_oooo_llll_((((_cccc_oooo_nnnn_ssss_tttt _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_nnnn_pppp_tttt_rrrr_,,,, _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_****_eeee_nnnn_dddd_pppp_tttt_rrrr_,,,, _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  17.  
  18.      _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _wwww_cccc_ssss_tttt_oooo_uuuu_llll_((((_cccc_oooo_nnnn_ssss_tttt _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_nnnn_pppp_tttt_rrrr_,,,, _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_****_eeee_nnnn_dddd_pppp_tttt_rrrr_,,,, _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  19.  
  20.      _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt _wwww_cccc_ssss_tttt_oooo_llll_llll_((((_cccc_oooo_nnnn_ssss_tttt _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_nnnn_pppp_tttt_rrrr_,,,, _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_****_eeee_nnnn_dddd_pppp_tttt_rrrr_,,,, _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  21.  
  22.      _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt _wwww_cccc_ssss_tttt_oooo_uuuu_llll_llll_((((_cccc_oooo_nnnn_ssss_tttt _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_nnnn_pppp_tttt_rrrr_,,,, _wwww_cccc_hhhh_aaaa_rrrr______tttt _****_****_eeee_nnnn_dddd_pppp_tttt_rrrr_,,,,
  23.      _iiii_nnnn_tttt _bbbb_aaaa_ssss_eeee_))))_;;;;
  24.  
  25. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN ((((IIIInnnntttteeeerrrrnnnnaaaattttiiiioooonnnnaaaallll FFFFuuuunnnnccccttttiiiioooonnnnssss))))
  26.      The _wwww_cccc_ssss_tttt_oooo_llll, _wwww_cccc_ssss_tttt_oooo_uuuu_llll, _wwww_cccc_ssss_tttt_oooo_llll_llll, and _wwww_cccc_ssss_tttt_oooo_uuuu_llll_llll functions convert the initial
  27.      portion of the wide character string pointed to by _n_p_t_r to _llll_oooo_nnnn_gggg _iiii_nnnn_tttt,
  28.      _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _iiii_nnnn_tttt, _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt, and _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt
  29.      representation, respectively. First these functions decompose the input
  30.      wide character string into three parts: an initial, possibly empty,
  31.      sequence of white-space wide-character codes (as specified by _i_s_w_s_p_a_c_e),
  32.      a subject sequence interpreted as an integer represented in some radix
  33.      determined by the value of _b_a_s_e; and a final wide character string of one
  34.      or more unrecognised wide character codes, including the terminating null
  35.      wide-character code of the input wide character string. Then these
  36.      functions attempt to convert the subject sequence to an integer, and
  37.      return the result.
  38.  
  39.      If _b_a_s_e is _0, the expected form of the subject sequence is that of a
  40.      decimal constant, octal constant or hexadecimal constant, any of which
  41.      may be preceded by a + or - sign. A decimal constant begins with a non-
  42.      zero digit, and consists of a sequence of decimal digits. An octal
  43.      constant consists of the prefix 0 optionally followed by a sequence of
  44.      the digits 0 to 7 only. A hexadecimal constant consists of the prefix 0x
  45.      or 0X followed by a sequence of the decimal digits and letters a (or A)
  46.      to f (or F) with values 10 to 15 respectively.
  47.  
  48.      If the value of _b_a_s_e is between 2 and 36, the expected form of the
  49.      subject sequence is a sequence of letters and digits representing an
  50.      integer with the radix specified by _b_a_s_e, optionally preceded by a + or -
  51.      sign, but not including an integer suffix. The letters from a (or A) to z
  52.      (or Z) inclusive are ascribed the values 10 to 35; only letters whose
  53.      ascribed values are less than that of _b_a_s_e are permitted. If the value of
  54.      _b_a_s_e is 16, the wide-character code representations of 0x or 0X may
  55.      optionally precede the sequence of letters and digits, following the sign
  56.      if present.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. wwwwccccssssttttoooollll((((3333SSSS))))                                                          wwwwccccssssttttoooollll((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      The subject sequence is defined as the longest initial subsequence of the
  75.      input wide character string, starting with the first non-white-space
  76.      wide-character code, that is of the expected form. The subject sequence
  77.      contains no wide-character codes if the input wide character string is
  78.      empty or consists entirely of white-space wide-character code, or if the
  79.      first non-white-space wide-character code is other than a sign or a
  80.      permissible letter or digit.
  81.  
  82.      If the subject sequence has the expected form and _b_a_s_e is 0, the sequence
  83.      of wide-character codes starting with the first digit is interpreted as
  84.      an integer constant. If the subject sequence has the expected form and
  85.      the value of _b_a_s_e is between 2 and 36, it is used as the base for
  86.      conversion, ascribing to each letter its value as given above. If the
  87.      subject sequence begins with a minus sign, the value resulting from the
  88.      conversion is negated. A pointer to the final wide character string is
  89.      stored in the object pointed to by _e_n_d_p_t_r, provided that _e_n_d_p_t_r is not a
  90.      null pointer.
  91.  
  92.      If the subject sequence is empty or does not have the expected form, no
  93.      conversion is performed; the value of _n_p_t_r is stored in the object
  94.      pointed to by _e_n_d_p_t_r, provided that _e_n_d_p_t_r is not a null pointer.
  95.  
  96. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
  97.      Upon successful completion, _wwww_cccc_ssss_tttt_oooo_llll, _wwww_cccc_ssss_tttt_oooo_llll_llll, _wwww_cccc_ssss_tttt_oooo_uuuu_llll, and _wwww_cccc_ssss_tttt_oooo_uuuu_llll_llll return
  98.      the converted value, if any. If no conversion could be performed, 0 is
  99.      returned and _e_r_r_n_o may be set to indicate the error.  If the correct
  100.      value is outside the range of representable values, {LONG_MAX},
  101.      {LONGLONG_MAX}, {ULONG_MAX}, {ULONGLONG_MAX}, {LONG_MIN}, {LONGLONG_MIN},
  102.      {ULONG_MIN}, or {ULONGLONG_MIN} is returned (according to the sign of the
  103.      value and which version of the routine is called--signed or unsigned),
  104.      and _e_r_r_n_o is set to [ERANGE].
  105.  
  106. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  107.      _wwww_cccc_ssss_tttt_oooo_llll, _wwww_cccc_ssss_tttt_oooo_llll_llll, _wwww_cccc_ssss_tttt_oooo_uuuu_llll, and _wwww_cccc_ssss_tttt_oooo_uuuu_llll_llll will fail if:
  108.  
  109.           [EINVAL]   The value of _b_a_s_e is not supported.
  110.  
  111.           [ERANGE]   The value to be returned is not representable.
  112.  
  113.      _wwww_cccc_ssss_tttt_oooo_llll, _wwww_cccc_ssss_tttt_oooo_llll_llll, _wwww_cccc_ssss_tttt_oooo_uuuu_llll, and _wwww_cccc_ssss_tttt_oooo_uuuu_llll_llll may fail if:
  114.  
  115.           [EINVAL]   No conversion could be performed.
  116.  
  117. AAAAPPPPPPPPLLLLIIIICCCCAAAATTTTIIIIOOOONNNN UUUUSSSSAAAAGGGGEEEE
  118.      Because 0, {LONG_MIN}, {LONGLONG_MIN}, {ULONG_MIN}, {ULONGLONG_MIN},
  119.      {LONG_MAX}, {LONGLONG_MAX}, {ULONG_MAX}, and {ULONGLONG_MAX}, are
  120.      returned on error and are also valid returns on success, an application
  121.      wishing to check for error situations should set _e_r_r_n_o to 0, then call
  122.      _wwww_cccc_ssss_tttt_oooo_llll, _wwww_cccc_ssss_tttt_oooo_llll_llll, _wwww_cccc_ssss_tttt_oooo_uuuu_llll, or _wwww_cccc_ssss_tttt_oooo_uuuu_llll_llll, then check _e_r_r_n_o and if it is 0,
  123.      assume an error has occurred.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. wwwwccccssssttttoooollll((((3333SSSS))))                                                          wwwwccccssssttttoooollll((((3333SSSS))))
  137.  
  138.  
  139.  
  140. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  141.      _wwww_cccc_tttt_yyyy_pppp_eeee(3S), _wwww_cccc_ssss_tttt_oooo_dddd(3S), _<<<<_wwww_cccc_hhhh_aaaa_rrrr_...._hhhh_>>>>, _<<<<_llll_iiii_mmmm_iiii_tttt_ssss_...._hhhh_>>>>.
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.